<template>
    <el-form ref="form" label-width="80px" size="small" :inline="true">
        <!-- <el-button
        type="warning"
        size="mini"
        @click="$refs.parameter.show(tableData)"
        >设置STC每日涨价幅度</el-button
      > -->
    </el-form>
    <el-row>
        <div class="title">充提参数：</div>
        <el-col :span="24">
            bsc 充值地址：<span>{{ parameter.ReceiveAddress }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter5.show(parameter)">修改</el-button>
        </el-col>
        <el-col :span="24">
            波场 充值地址：<span>{{ parameter.TrxAddr }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter6.show(parameter)">修改</el-button>
        </el-col>
        <el-col :span="24">
            节点U 充值地址：<span>{{ parameter.Uaddress }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter15.show(parameter)">修改</el-button>
        </el-col>
        <el-col :span="24">
            提币地址：<span>{{ parameter.SendAddr }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter7.show(parameter)">修改</el-button>
        </el-col>
        <el-col :span="24">
            自动提币USDT：<span>{{ ['后台审核', '自动提币'][parameter.AutoSend] }}</span>
            自动提币HF：<span>{{ ['后台审核', '自动提币'][parameter.SendHF] }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter8.show(parameter)">修改</el-button>
        </el-col>
        <el-col :span="24">
            每日提币数量：<span>{{ parameter.SendAmount }}</span>
            每日提币次数：<span>{{ parameter.SendCount }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter14.show(parameter)">修改</el-button>
        </el-col>
        <div class="title">入金参数：</div>
        <el-col :span="24">
            价格：<span>{{ parameter.PriceUpRate }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter3.show(parameter)">修改</el-button>
        </el-col>
        <el-col :span="24">
            预赛：<span>{{ parameter.Invest1 }}</span>
            半决赛：<span>{{ parameter.Invest15 }}</span>
            决赛：<span>{{ parameter.Invest30 }}</span>
            总决赛：<span>{{ parameter.Invest90 }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter4.show(parameter)">修改</el-button>
        </el-col>
        <el-col :span="24">
            加时赛最大数量：<span>{{ parameter.MaxOrderAmount }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter9.show(parameter)">修改</el-button>
        </el-col>
        <div class="title">节点：</div>
        <el-col :span="24">
            初级节点分红： <span>{{ parameter.Node0 }}</span>
            中级节点分红：<span>{{ parameter.Node1 }}</span>
            高级节点分红：<span>{{ parameter.Node2 }}</span>
            <span>{{ !parameter.NodeOpen?'关闭购买':'开放购买' }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter13.show(parameter)">修改</el-button>
        </el-col>

        <div class="title">游戏参数：</div>
        <el-col :span="24">
            游戏数量1：<span>{{ parameter.Amount1 }}</span>
            数量2：<span>{{ parameter.Amount2 }}</span>
            数量3：<span>{{ parameter.Amount3 }}</span>
            数量4：<span>{{ parameter.Amount4 }}</span>
            数量5：<span>{{ parameter.Amount5 }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter2.show(parameter)">修改</el-button>
        </el-col>

        <el-col :span="24">
            体验券价值：<span>{{ parameter.CouponValue }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter10.show(parameter)">修改</el-button>
        </el-col>
        <el-col :span="24">
            游戏每轮间隔：<span>{{ parameter.GameInterval1 }}
                ，{{ parameter.GameInterval2 }}
                ，{{ parameter.GameInterval3 }}
                ，{{ parameter.GameInterval4 }}
                ，{{ parameter.GameInterval5 }}
            </span>
            <el-button type="warning" size="small" @click="$refs.parameter11.show(parameter)">修改</el-button>
        </el-col>
        <el-col :span="24">
            游戏时间：<span>
                {{ repair(parameter.LimitedTime?.split(",")[0]) }}:{{ repair(parameter.LimitedTime?.split(",")[1]) }}-{{
                    repair(parameter.LimitedTime?.split(",")[2]) }}:{{ repair(parameter.LimitedTime?.split(",")[3]) }}，
                {{ repair(parameter.LimitedTime?.split(",")[4]) }}:{{ repair(parameter.LimitedTime?.split(",")[5]) }}-{{
                    repair(parameter.LimitedTime?.split(",")[6]) }}:{{ repair(parameter.LimitedTime?.split(",")[7]) }}，
                {{ repair(parameter.LimitedTime?.split(",")[8]) }}:{{ repair(parameter.LimitedTime?.split(",")[9]) }}-{{
                    repair(parameter.LimitedTime?.split(",")[10]) }}:{{ repair(parameter.LimitedTime?.split(",")[11]) }}
            </span>
            <el-button type="warning" size="small" @click=" loading12 = true, $refs.parameter12.show(parameter.LimitedTime?.split(','))" :loading="loading12">修改</el-button>
        </el-col>

        <div class="title">质押HF：</div>
        <el-col :span="24">
            Dao分红：<span>{{ parameter.Dao0 }}</span><span>{{ parameter.Dao1 }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter16.show(parameter)">修改</el-button>
        </el-col>
        <el-col :span="24">
            HF比例：<span>{{ parameter.HFRate }}</span>
            <el-button type="warning" size="small" @click="$refs.parameter17.show(parameter)">修改</el-button>
        </el-col>

    </el-row>
    <parameter-modal3 ref="parameter3" @loadData="loadData" />
    <parameter-modal2 ref="parameter2" @loadData="loadData" />
    <parameter-modal4 ref="parameter4" @loadData="loadData" />
    <parameter-modal5 ref="parameter5" @loadData="loadData" />
    <parameter-modal6 ref="parameter6" @loadData="loadData" />
    <parameter-modal7 ref="parameter7" @loadData="loadData" />
    <parameter-modal8 ref="parameter8" @loadData="loadData" />
    <parameter-modal9 ref="parameter9" @loadData="loadData" />
    <parameter-modal10 ref="parameter10" @loadData="loadData" />
    <parameter-modal11 ref="parameter11" @loadData="loadData" />
    <parameter-modal12 ref="parameter12" @loadData="loadData" @cloneLoading12="loading12 = false" />
    <parameter-modal13 ref="parameter13" @loadData="loadData" />
    <parameter-modal14 ref="parameter14" @loadData="loadData" />
    <parameter-modal15 ref="parameter15" @loadData="loadData" />
    <parameter-modal16 ref="parameter16" @loadData="loadData" />
    <parameter-modal17 ref="parameter17" @loadData="loadData" />

</template>

<script lang="ts" setup>
import { reactive, ref, onMounted, computed } from "vue";
import { setParameterAddress, getParameter } from "~/api";
const parameter = ref({});
const loading12 = ref(false);
const loadData = async () => {
    getParameter().then((res) => {
        console.log(res);
        parameter.value = res.data.data.Parameter;
    });
};
const repair = (mull) => {
    if (Number(mull) < 10) {
        return "0" + mull;
    } else {
        return mull;
    }
};
onMounted(() => {
    loadData();
});
</script>

<style lang="scss" scoped>
.el-row {
    padding: 20px;
}

.title {
    font-size: 16px;
    font-weight: bold;
    padding: 10px 0;
}

.el-col {
    font-size: 14px;
    line-height: 38px;
    opacity: 0.9;

    span {
        margin-right: 16px;
        font-weight: bold;
        color: red;
        font-size: 16px;
    }

    i {
        margin-left: 10px;
        color: red;
        font-style: normal;
    }
}
</style>
